<template>
	<div>
		
		<div class="list-box">
			<div v-for="(item,index) in classList" @click="toDetails(item.id)">
				<img :src="item.pic" width="100px">
			</div>
		</div>
		
	</div>
</template>

<script>
	export default{
		data(){
			return{
				list:[],
				classList:[]
			}
		},
		mounted() {
			let id = this.$route.query.id
			this.$netClient.getStoreList({}).then(res=>{
				// console.log(res.data.data)
				this.list = res.data.data
				
				this.list.forEach(item=>{
					if(id == item.categoryId){
						this.classList.push(item)
					}
				})
			})
			
		},
		methods:{
			toDetails(id){
				this.$router.push({
					path:'/details2',
					query:{
						id
					}
				})
			}
		}
	}
</script>

<style scoped>
	.list-box{
		font-size: 0.18rem;
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
	}
	.list-box > div {
		margin: 5px 10px;
	}
</style>
